package io.jee.medusa;

import javax.annotation.Resource;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.env.Environment;

public abstract class ConstantSupport implements InitializingBean {
	
	public static boolean PRODUCTION = false;
	
	public final static String PROFILE_PRODUCTION_KEY = "pro";
	
	public final static String PROFILE_DEVELOP_KEY = "dev";
	
	public final static String PROFILE_MASTER_KEY = "master";
	
	public final static String PROFILE_SLAVE_KEY = "slave";
	
	private static Environment env;
	
	@Override
	public void afterPropertiesSet() throws Exception {
		PRODUCTION = env.acceptsProfiles(PROFILE_PRODUCTION_KEY);
	}

	public static Environment getEnv() {
		return env;
	}

	@Resource
	public void setEnv(Environment env) {
		ConstantSupport.env = env;
	}

	
}
